#include <cmath>
#include <cstdlib>
#include <iostream>
using namespace std;
 
bool isPrime(long long n)
{
    if(n < 2)
        return false;
    for(int i = 2; i <= sqrt(n); ++i)
    {
        if(n % i == 0)
            return false;
    }
    return true;
}
 
int main()
{
    string str;
    cin >> str;
    string tmp = str;
    for(int i = str.size() - 2; i >= 0; --i)
    {
        tmp += str[i];
    }
    long long n = atoll(tmp.c_str()); // to long long!!!
    // cout << n << " ";
    if(isPrime(n))
        cout << "prime" << endl;
    else
        cout << "noprime" << endl;
    return 0;
}